package com.csair.seam.infrastructure.web.user;

import java.io.Serializable;

import com.csair.seam.domain.model.entity.SysUser;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * @Author: wurunbin
 * @Date: 2020/3/5 14:02
 * @Description: 保存用户信息
 **/
@Getter
@Setter
@ApiModel
public class UserInfo implements Serializable {

	private static final long serialVersionUID = -2831895976383942116L;

	@ApiModelProperty(value = "ID")
    private String id;

    @ApiModelProperty(value = "账号")
    private String account;

    @ApiModelProperty(value = "姓名")
    private String name;
    
    @ApiModelProperty(value = "所属组织id")
    private String orgId;
    
    @ApiModelProperty(value = "设备数量")
    private Integer equipNum = 0;
    
    @ApiModelProperty(value = "设备价格")
    private Double equipPrice = 0D;

    @ApiModelProperty(value = "是否是管理员")
    private boolean isAdmin = false;
    
    @ApiModelProperty(value = "jwtToken")
    private String token ;
    
    @ApiModelProperty(value = "今日访问量")
    private int todayUv;
    
    @ApiModelProperty(value = "总访问量")
    private int totalUv;

    public UserInfo(SysUser sysUser){
        this.id = sysUser.getId();
        this.account = sysUser.getAccount();
        this.name = sysUser.getName();
        this.orgId = sysUser.getOrgId();
    }

    public UserInfo(String account){
        this.account = account;
    }
}
